import logging
from celery import shared_task
from fuguangapi.utils.ronglianyunapi import send_sms as sms
logger = logging.getLogger("django")

@shared_task(name="add")
def add(x,y):
    return x+y

@shared_task(name="sms")
def send_sms(tid, mobile, datas):
    """异步发送短信"""
    try:
        return sms(tid, mobile, datas)
    except Exception as e:
        logger.error(f"发送短信失败: {e}")